package factoryMethodPattern;

/**
 * @author Yin_JC
 * @PackageName:factoryMethodPattern
 * @Class:Client
 * @Description:
 * @date 2020/4/2 14:29
 */

public class Client {
    public static void main(String[] args) throws ClassNotFoundException, IllegalAccessException, InstantiationException {
        String name = "factoryMethodPattern.HaisenseTVFactory";
        Class c = Class.forName(name);
        Object j = c.newInstance();
        TVFactory tvFactory = (TVFactory) j;
        TV tv = tvFactory.produce();
        tv.play();
    }
}
